<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>消息详情</title>
    <link rel="stylesheet" href="plugins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="css/comments.css" media="all">
    <style>
        .layui-form-label{
            width: 110px;
        }
        .layui-input-block{
            margin-left: 150px;
        }
    </style>
</head>
<body>
    <div class="maincontainer">
        <blockquote class="layui-elem-quote">
            消息详情
            <button type="button" class="layui-btn layui-btn-sm" style="float: right;margin-top: -4px;" onclick="window.history.back();">返回</button>
        </blockquote>
        <form class="layui-form" action="" lay-filter="example">
            <div class="layui-form-item">
              <label class="layui-form-label">消息标题：</label>
			  <div class="layui-form-mid layui-word-aux title"></div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">时间：</label>
                <div class="layui-form-mid layui-word-aux createTime"></div>
            </div>
            <div class="layui-form-item">
              <label class="layui-form-label">消息内容：</label>
			  <div class="layui-form-mid layui-word-aux content"></div>
            </div>
        </form>
    </div>
<script type="text/javascript" src="plugins/layui/layui.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script>

    layui.config({
        base: 'plugins/layui/modules/',
    }).use(['http', 'form'], function() {
        var http = layui.http,
            form = layui.form;

        var id = http.getPid('id')
        var readStatus = http.getPid('readStatus')
        if(readStatus==0){ // 读取消息
            http.post('supplier/admin/message/read',{
                id: id
            },function(res){
                
            })
        }

        // 消息详情
        getPermission();
        function getPermission(){
            http.get('supplier/admin/message/findById',{
                id: id
            },function(res){
                if(res.code == 200){
                    var data = res.data;
                    $('.title').html(data.title);
                    $('.createTime').html(data.createTime);
                    $('.content').html(data.content);
                }else{
                    layer.msg(res.msg);
                }
            });
        }
    })
</script>
</body>